<h5>资产维修</h5>
<div class="content">
  <form #repaireditForm="ngForm">
    <div class="assetusemsg">
      <div class="form-group  w-33">
        <label class="mr-2">报修原因</label>
        <input required class="form-control mr-2" type="text"  placeholder="请输入报修原因" [(ngModel)]="deliver.reason" name="reason" readonly>
      </div>
      <div class="form-group  w-33">
        <label class="mr-2">维修花费</label>
        <input  class="form-control mr-2" type="text"  placeholder="请输入维修花费" [(ngModel)]="deliver.money" name="money">
      </div>
      <div class="form-group  w-33">
        <label class="mr-2">维修状态</label>
        <select required class="form-control mr-2" type="text"  [(ngModel)]="deliver.status" name="status">
          <option [value]="RepairStatus.REPAIRING">{{RepairStatusMap[RepairStatus.REPAIRING]}}</option>
          <option [value]="RepairStatus.FINISH">{{RepairStatusMap[RepairStatus.FINISH]}}</option>
        </select>
        <div class="red" *ngIf="messages.status">{{ messages.status }}</div>
      </div>
      <div class="form-group  w-33">
        <label class="mr-2">处理人</label>
        <input class="form-control mr-2" type="text"  value="管理员" readonly>
      </div>
    </div>
    <div class="w-100">
      <label>维修备注</label>
      <div class="form-group">
        <textarea class="form-control" style="width: 93%;resize: none" [(ngModel)]="deliver.remark" name="remark"></textarea>
      </div>
    </div>

    <div class="grid">
      <table mat-table [dataSource]="deliver.list | paginate: {itemsPerPage: pageSize, currentPage: page, totalItems: total}"  [trackBy]="trackById" class="table-hover table-bordered w-100">
        <ng-container matColumnDef="select">
          <th mat-header-cell *matHeaderCellDef>
            <mat-checkbox (change)="$event? allToggle() : null"
                          [checked]="selection.hasValue() && isAllSelected()"
                          [indeterminate]="selection.hasValue() && !isAllSelected()"
            >
            </mat-checkbox>
          </th>
          <td mat-cell *matCellDef="let row">
            <mat-checkbox (change)="$event ? itemChanged(row,$event): null"
                          (click)="$event.stopPropagation()"
                          [checked]="selection.isSelected(row)">
            </mat-checkbox>
          </td>
        </ng-container>

        <ng-container matColumnDef="assetCode">
          <th mat-header-cell *matHeaderCellDef>资产编码</th>
          <td mat-cell *matCellDef="let row">{{ row.assetCode}}</td>
        </ng-container>

        <ng-container matColumnDef="assetName">
          <th mat-header-cell *matHeaderCellDef>资产名称</th>
          <td class="overWords" mat-cell *matCellDef="let row ">{{ row.assetName }}</td>
        </ng-container>

        <ng-container matColumnDef="assetType">
          <th mat-header-cell *matHeaderCellDef>资产类别</th>
          <td mat-cell *matCellDef="let row">{{ row.oaAssetType?.GDZCLBMC }}</td>
        </ng-container>

        <ng-container matColumnDef="assetDate">
          <th mat-header-cell *matHeaderCellDef>入库时间</th>
          <td mat-cell *matCellDef="let row">{{ row.buyDate | date: 'yyyy-MM-dd' }}</td>
        </ng-container>

        <ng-container matColumnDef="departName">
          <th mat-header-cell *matHeaderCellDef>使用部门</th>
          <td class="overWords" mat-cell *matCellDef="let row ">{{ row.sysDepartment.departName }}</td>
        </ng-container>

        <ng-container matColumnDef="username">
          <th mat-header-cell *matHeaderCellDef>使用人</th>
          <td class="overWords" mat-cell *matCellDef="let row ">{{ row.sysUser.username}}</td>
        </ng-container>

        <!--对应列名List.ts中定义-->
        <tr mat-header-row *matHeaderRowDef="cols"></tr>
        <tr mat-row *matRowDef="let data; columns: cols"></tr>
      </table>

    </div>
    <app-pagination
      (pageChange)="onPageChanged($event)"
      [maxSize]="9"
      [isShowInput]="true"
      [isMiniMode]="false"
      [total]="total"
    >
    </app-pagination>
  </form>
</div>
<div class="buttons text-center">
  <button class="btn btn-outline-primary mr-2" type="button" (click)="onSubmit()">保存</button>
  <button class="btn btn-outline-secondary" type="button" [mat-dialog-close] cdkFocusInitial>取消</button>
</div>

